package com.tinem.platform.module.starter.jpa.entity.link;

import com.tinem.platform.module.pojo.enums.message.ResourceType;
import com.tinem.platform.module.pojo.enums.web.LinkType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className Link
 * @description 链接
 * @site
 * @company
 * @create 2021-10-29
 */
@Data
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name="t_link")
@ApiModel("链接")
public class Link implements Serializable,Cloneable{
    @Id
    @Column(name = "c_id",nullable=true)
    @ApiModelProperty(name = "id", value = "编号",required = true)
    private String id;

    @Enumerated(EnumType.STRING)
    @Column(name = "c_link_type",nullable=true)
    @ApiModelProperty(name = "linkType", value = "链接类型",required = true)
    private LinkType linkType;

    @Enumerated(EnumType.STRING)
    @Column(name = "c_resource_type",nullable=true)
    @ApiModelProperty(name = "resourceType", value = "资源类型",required = true)
    private ResourceType resourceType;

    @Column(name = "c_resource_id",nullable=true)
    @ApiModelProperty(name = "resourceId", value = "资源编号",required = true)
    private String resourceId;

    @Column(name = "c_client_id",nullable=true)
    @ApiModelProperty(name = "clientId", value = "客户端编号",required = true)
    private String clientId;

    @Column(name = "c_old_link",nullable=true)
    @ApiModelProperty(name = "oldLink", value = "原始链接",required = true)
    private String oldLink;

    @Column(name = "c_new_link",nullable=true)
    @ApiModelProperty(name = "newLink", value = "新链接",required = true)
    private String newLink;

    @Column(name = "c_data",nullable=true)
    @ApiModelProperty(name = "data", value = "DATA数据",required = true)
    private String data;

    @Column(name = "c_expire_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "expireTime", value = "过期时间",required = false)
    private Date expireTime;

    @Column(name = "c_limit_time",nullable=true)
    @ApiModelProperty(name = "limitTime", value = "访问限制次数",required = true)
    private Integer limitTime;

    @Column(name = "c_visit_time",nullable=true)
    @ApiModelProperty(name = "visitTime", value = "访问次数",required = true)
    private Integer visitTime;

    @Version
    @Column(name = "c_revision",nullable=true)
    @ApiModelProperty(name = "revision", value = "乐观锁",required = false)
    private Integer revision;

    @Column(name = "c_created_by",nullable=true)
    @ApiModelProperty(name = "createdBy", value = "创建人",required = false)
    private String createdBy;

    @Column(name = "c_created_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "createdTime", value = "创建时间",required = false)
    private Date createdTime;

    @Column(name = "c_updated_by",nullable=true)
    @ApiModelProperty(name = "updatedBy", value = "更新人",required = false)
    private String updatedBy;

    @Column(name = "c_updated_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "updatedTime", value = "更新时间",required = false)
    private Date updatedTime;

}